
#pragma once

#include <ttg/math.h>
#include <ttg/services.h>
#include "Common.h"

using namespace ttg::math;

//Finds count of primes, that is greater or equal to n.
//Returns elapsed time in seconds.
std::pair<uint64, double> serialPrimes(ttg::math::uint64 n)
{
	//Preparing.
	PrimeFinderPool pool;
	//Counting.
	double t_start = ttg::services::Timer::getRef()->getSeconds();
	uint64 count = pool.findPrimes(0, n + 1);
	double t_end = ttg::services::Timer::getRef()->getSeconds();
	//Returning result.
	return std::make_pair(count, t_end - t_start);
}
